#include "circle.h"
#include "rectangle.h"
#include "square.h"
#include "triangle.h"

int main()
{
    float a, b, c, d, e;
    cout<<"请输入圆的半径"<<endl;
    cin>>a;
    cout<<"请输入长方形的长和宽"<<endl;
    cin>>b>>c;
    cout<<"请输入正方形的边长"<<endl;
    cin>>d;
    cout<<"请输入等边三角形的边长"<<endl;
    cin>>e;
    shape *C = new circle(a);
    shape *Rec = new rectangle(b,c);
    shape *S = new square (d);
    shape *Tri = new triangle (e);

    cout << "圆的周长是"<< C->Perimeter() <<endl;
    cout << "圆的面积是"<< C->area() <<endl<<endl;

    cout << "长方形的周长是"<< Rec->Perimeter() <<endl;
    cout << "长方形的面积是"<< Rec->area() <<endl<<endl;

    cout << "正方形的周长是"<< S->Perimeter() <<endl;
    cout << "正方形的面积是"<< S->area() <<endl<<endl;
    
    cout << "等边三角形的周长是"<< Tri->Perimeter() <<endl;
    cout << "等边三角形的面积是"<< Tri->area() <<endl;
    
    delete C;
    delete Rec;
    delete S;
    delete Tri;
}
